/*  INFO THIS
 * file: word.c */
# ifndef L_LIB_WORD_U
# define L_LIB_WORD_U

// /*  USE
 // * THIS word__clear
 // * THIS word__copy */
// # include <stdio.h>
// /*  INCLUDE
 // * printf */

/*  */
# include <iostream>
/*  INCLUDE
 * std::cout
 * std::endl */

// /*  USE
 // * THIS word__create */
// # include <stdlib.h>
// /*  INCLUDE
 // * malloc
 // * free */

/* TODO THOUGH
 * word__clear = word__init ??? */
/*  USE
 * THIS word__clear
 * THIS word__init */
# include <stddef.h>
/*  INCLUDE
 * NULL */

/*  USE
 * THIS word__clear
 * THIS word__copy */
# include "word.h"
/*  INCLUDE
 * Word
 * Word.value
 * Word.previous
 * Word.next
 * word__clear
 * word__copy */

/*  USE
 * THIS symbols__clear
 * THIS symbols__copy */
// # include "symbols.h"
/*  INCLUDE
 * Symbols
 * String
 * symbols__clear
 * symbols__copy */

/*  INFO
 * do: COPY Word */
Word::Word (Word &word)
{
  /* set value */
  this->value = word.value;
  
  /* set point previous */
  this->previous = word.previous;
  
  /* set point next */
  this->next = word.next;
  
  /* log */
  printf ("word copyed\n");
}

// /*  INFO
 // * do: CHECK symbols */
// void
// int__check (int *self)
// {
  // if (self == NULL)
  // {
    // printf ("12");
  // }
// }

/*  INFO
 * do: REMOVE Word */
Word::~Word ()
{
  /* if self void then error not will */
  // int__check (&self->value__for__test);
  
  /* */
  this->clear ();

  /* log */
  fprintf (stderr, "word delete\n\n");
}

/*  INFO
 * do: PRINT Word */
void
Word::print ()
{
  /* print */
  std::cout << this->value << std::endl;
}

/*  USE
 * L__LIB_WORD__CREATE THIS
 * L__LIB_WORD__DELETE THIS */
/*  INFO word__clear
 * do: Clear Word */
void
Word::clear ()
{
  // symbols__clear (this->value);
  // symbols__copy (this->value, "this text is empty");
  // symbols__copy (this->value, "this text is empty");
  
  /* clear point previous */
  this->value = "";
    
  /* clear point previous */
  this->previous = NULL;
  
  /* clear point next */
  this->next = NULL;
  
  /* log */
  fprintf (stderr, "word clear\n");
}

/*  INFO word__create
 * do: CREATE Word */
Word::Word ()
{
  /* log */
  fprintf (stderr, "\nword create\n");
  
  /* create new Word in Dinamic Memory */
  // Word *self = new Word;
  // self->value = malloc (sizeof (Symbols));

  /* init self Word */
  // word__init (self) or
  // word__zero (self) or
  this->clear ();
}

# endif /* L_LIB_WORD_U */

